using UnityEngine;
using System.Collections;

public class Cheat : MonoBehaviour {

	private string cheatCode = "bittemple";
	private int count;
	private bool reload;
	private char[] cheatCodeChar;
	private bool run = true;
	
	private string debugString;
	
	void Awake()
	{
		cheatCodeChar = cheatCode.ToCharArray();	
	}
	
	void Update () 
	{
		if(count < cheatCodeChar.Length)
		{
			if(Input.inputString.Length >0)
			{
				if(Input.inputString[0] == cheatCodeChar[count])
				{
					count ++;
				}
				else
				{
					Reload();
				}
			}
		}
		else
		{
			Camera.mainCamera.gameObject.SendMessage("Began",SendMessageOptions.DontRequireReceiver);
			Reload();
		}
		
	}
	
	void Reload()
	{
		this.count = 0;
	}
}
